<!DOCTYPE html>
{% load staticfiles %}
<html>
    <head>
        <script>
            function add(){
                window.location.href = "/homeapp/add";
            }

            function delthis(strguid){
                if (!confirm("确定删除？")){
                    return false;
                }
                window.location.href = "/homeapp/delete?guid=" + strguid;
            }

            function updatethis(strguid){
                window.location.href = "/homeapp/update?guid=" + strguid;
            }
        </script>
        

        
        <link rel="stylesheet" type="text/css" href="{% static 'styles/a.css' %}" />
        <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap-theme.css' %}" />
        <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap.css' %}" />
        <script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.js' %}" ></script>
        <script type="text/javascript" src="{% static 'bootstrap/js/npm.js' %}" ></script>
        <script type="text/javascript" src="{% static 'scripts/test.js' %}" ></script>


        <script type="text/javascript">
onload = function(){
    test_func();
};
        </script>
    </head>
    <body>
    <ul>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>
        <li>123</li>
    </ul>
    <img src="{% static "img/a.jpg" %}" alt="this is jordan" />
    <a href="javascript:add()" >添加</a>
    hello, world<br />
    viewmodel.name = {{ viewmodel.name  }}<br />
    viewmodel.age = {{ viewmodel.age  }}<br />
    pageIndex = {{ viewmodel.pageIndex }}
        <table>
    {% for item in viewmodel.models  %}
             <tr>
                 <td>{{ item.guid  }}</td>
                <td>{{ item.uname  }}</td>
                 <td>{{ item.upwd  }}</td>
                 <td>{{ item.haha  }}</td>
                 <td><input type="button" value="删除" onclick="delthis('{{ item.guid }}')"/>         </td>
                 <td><input type="button" value="修改" onclick="updatethis('{{ item.guid }}')"/>         </td>
            </tr>
    {% endfor %}
         </table>
        {% comment %}
         <form method="post" action="" enctype="multipart/form-data" >
             {% csrf_token %}
             <input type="text" name="uname" value="" placeholder="请输入名字"/>
             <input type="text" name="upwd" value="" placeholder="请输入密码"/>
             <input type="submit" value="提交" />
         </form>
         {% endcomment %}
         <label>同时增加两条数据的事务测试</label>
         <form method="post" action="" enctype="multipart/form-data" >
             {% csrf_token %}
             <label>表TTest</label>
             <input type="text" name="uname" value="" placeholder="请输入名字"/>
             <input type="password" name="upwd" value="" placeholder="请输入密码"/><br />
             <label>表TTest</label>
             <input type="text" name="rname" value="" placeholder="请输入rname"/>
             <input type="submit" value="提交" />
         </form>
         {{ viewmodel.sessionname }}
     </body>
</html>
